<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<script>
function validatebill(){

var airwayno = document.myForm.a1;
var rrcompany = document.myForm.r1;
var rrcontact = document.myForm.r2;
var rraddress = document.myForm.r3;
var rrcountry = document.myForm.r4;
var rrcity = document.myForm.r5;
var rrpostal = document.myForm.r6;
var rrphone = document.myForm.r7;
var sscompany = document.myForm.s1;
var sscontact = document.myForm.s2;
var ssaddress = document.myForm.s3;
var sscountry = document.myForm.s4;
var sscity = document.myForm.s5;
var sspostal = document.myForm.s6;
var ssphone = document.myForm.s7;
var amount = document.myForm.g4;
var weigth = document.myForm.g2;
var pickup = document.myForm.g5;


if (airwayno.value == "")
    {
        window.alert("Empty airway bill no field.");
        airwayno.focus();
        return false;
    }

if (rrcompany.value == "")
    {
        window.alert("Empty company name field in receiver section.");
        rrcompany.focus();
        return false;
    }
if (rrcontact.value == "")
    {
        window.alert("Empty contact name field in receiver section.");
        rrcontact.focus();
        return false;
    }
if (rraddress.value == "")
    {
        window.alert("Empty address field in receiver section.");
        rraddress.focus();
        return false;
    }  
if (rrcountry.value == "")
    {
        window.alert("Empty country field in receiver section.");
        rrcountry.focus();
        return false;
    } 
if (rrcity.value == "")
    {
        window.alert("Empty city field in receiver section.");
        rrcity.focus();
        return false;
    }
if (rrpostal.value == "")
    {
        window.alert("Empty postal code field in receiver section.");
        rrpostal.focus();
        return false;
    } 
if (rrphone.value == "")
    {
        window.alert("Empty phone no field in receiver section.");
        rrphone.focus();
        return false;
    }    
       
        
if (sscompany.value == "")
    {
        window.alert("Empty company name field in sender section.");
        sscompany.focus();
        return false;
    }
if (sscontact.value == "")
    {
        window.alert("Empty contact name field in sender section.");
        sscontact.focus();
        return false;
    }
if (ssaddress.value == "")
    {
        window.alert("Empty address field in sender section.");
        ssaddress.focus();
        return false;
    }  
if (sscountry.value == "")
    {
        window.alert("Empty country field in sender section.");
        sscountry.focus();
        return false;
    } 
if (sscity.value == "")
    {
        window.alert("Empty city field in sender section.");
        sscity.focus();
        return false;
    }
if (sspostal.value == "")
    {
        window.alert("Empty postal code field in sender section.");
        sspostal.focus();
        return false;
    } 
if (ssphone.value == "")
    {
        window.alert("Empty phone no field in sender section.");
        ssphone.focus();
        return false;
    }
if (pickup.value == "")
    {
        window.alert("Empty picked up field.");
        pickup.focus();
        return false;
    }    
    
if (amount.value == "" || amount.value=="NaN")
    {
        window.alert("Empty total amount field.");
        weigth.focus();
        return false;
    }    

       
        
var regExp = /cms((\d){8})/g; 
if(!regExp.test(document.myForm.a1.value)){
alert('Invalid Airway bill no! \n\n Please enter a valid Airway bill no (e.g cms12345678)');
return;
}

var regExp1 = /\D/g;
if(regExp1.test(document.myForm.r6.value)){
alert('Invalid Postal Code! \n\n Please enter a valid postal code in receiver section.');
return;
}

var regExp2 = /\D/g;
if(regExp2.test(document.myForm.r7.value)){
alert('Invalid Phone number! \n\n Please enter a valid phone number in receiver section.');
return;
}


var regExp3 = /\D/g;
if(regExp3.test(document.myForm.s6.value)){
alert('Invalid Postal Code! \n\n Please enter a valid postal code in sender section.');
return;
}

var regExp4 = /\D/g;
if(regExp4.test(document.myForm.s7.value)){
alert('Invalid Phone number! \n\n Please enter a valid phone number in sender section.');
return;
}






document.myForm.submit();
}

function mul(obj)
{
var a,b,c,d;
a = parseInt(obj.form.elements['g2'].value) * parseInt(obj.form.elements['g3'].value);
b=a*15/100;
c=a+b;
d=c*20/100;
obj.value=c-d;
if(obj.value == "NaN")
{
alert("Please enter valid numbers");
}
}
</script>

<script language="javascript">
<!--
function init(){
var months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var xf = document.getElementById("f1")
var xDate = new Date();
var xMonth = months[xDate.getMonth()];
var xDay = xDate.getDate();
var xYear = xDate.getYear();

xf.value = xMonth + " " + xDay + ", " + xYear;
}
</script> 

<title>CMS Airway Bill</title>
</head>

<body leftmargin=0 topmargin=0 onload='init();'>
<form METHOD="POST" ACTION="http://localhost:8080/myapp/shipmentservlet" Name="myForm" onsubmit="return false;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="181">
  <tr>
    <td width="100%" height="25" bgcolor="#FFFFFF" background="menu.gif">
    <p align="center"><b><font face="Comic Sans MS" color="#666666" size="4">CMS Airway 
    Bill </font></b></td>
  </tr>
  <tr>
    <td width="100%" height="25" bgcolor="#FFFFFF" background="menu.gif">
    <p align="center"><font face="Comic Sans MS" size="2" color="#666666">
    Reference: Registered Customer</font></td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="19">
<p align="left">&nbsp;</td>

  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="23">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
      <tr>
        <td width="38%">
        <p align="center"><b><font size="2" color="#666666" face="Arial">Airway Bill no:</font></b>
<INPUT TYPE="text" name="a1" size="20" ></td>
        <td width="30%">
        <p align="center">
&nbsp;</td>
        <td width="32%">
        <p align="center">

<b><font size="2" color="#666666" face="Arial">Date:</font></b>
<INPUT TYPE="text" name="a2" size="20" value="" id="f1" readonly='true' onClick='alert("Warning!!\n\nYou donot change this date.");'></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="19">&nbsp;</td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="23">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="23%" id="AutoNumber3" background="menu.gif">
      <tr>
        <td width="100%" bgcolor="#FFFFFF" background="menu.gif">
        <font face="Comic Sans MS" color="#666666">Receiver 
        Information</font></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="10">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" height="7">
      <tr>
        <td width="50%" height="22"><b><font face="Arial" size="2" color="#666666">Company 
        name : </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="r1" size="20"></b></font></td>
        <td width="50%" height="22">
        <p align="center"><b><font size="2" face="Arial" color="#666666">Contact 
        name : </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="r2" size="20"></b></font></td>
      </tr>
      <tr>
        <td width="50%" height="1">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5" height="6">
          <tr>
            <td width="28%" valign="top" height="6"><b>
            <font face="Arial" size="2" color="#666666">Address :</font></b></td>
            <td width="72%" height="6">&nbsp;<textarea name="r3" rows="6" cols="20"></textarea><p>&nbsp;</td>
          </tr>
        </table>
        </td>
        <td width="50%" height="1" valign="top">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6">
          <tr>
            <td width="100%">
            <p align="center"><b><font size="2" face="Arial" color="#666666">
            Country :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="r4" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            City : </font></b><font face="Arial" color="#666666"><b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" name="r5" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            Postal code :&nbsp;&nbsp;&nbsp;&nbsp; </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="r6" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            Phone no :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="r7" size="20"></b></font></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td width="50%" height="19">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="45%" id="AutoNumber7" background="menu.gif">
          <tr>
            <td width="100%" bgcolor="#FFFFFF" background="menu.gif">
            <font face="Comic Sans MS" color="#666666">Sender 
            Information</font></td>
          </tr>
        </table>
        </td>
        <td width="50%" height="19">&nbsp;</td>
      </tr>
      <tr>
        <td width="50%" height="22"><b><font face="Arial" size="2" color="#666666">Company 
        name : </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="s1" size="20"></b></font></td>
        <td width="50%" height="22">
        <p align="center"><b><font size="2" face="Arial" color="#666666">Contact 
        name : </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="s2" size="20"></b></font></td>
      </tr>
      <tr>
        <td width="50%" height="1">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5" height="6">
          <tr>
            <td width="28%" valign="top" height="6"><b>
            <font face="Arial" size="2" color="#666666">Address :</font></b></td>
            <td width="72%" height="6">&nbsp;<textarea name="s3" rows="6" cols="20"></textarea><p>&nbsp;</td>
          </tr>
        </table>
        </td>
        <td width="50%" height="1" valign="top">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6">
          <tr>
            <td width="100%">
            <p align="center"><b><font size="2" face="Arial" color="#666666">
            Country :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="s4" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            City : </font></b><font face="Arial" color="#666666"><b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" name="s5" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            Postal code :&nbsp;&nbsp;&nbsp;&nbsp; </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="s6" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%">
            <p align="center"><b><font face="Arial" size="2" color="#666666">
            Phone no :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="s7" size="20"></b></font></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td width="50%" height="19">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="45%" id="AutoNumber8" background="menu.gif">
          <tr>
            <td width="100%" bgcolor="#FFFFFF" background="menu.gif">
            <font face="Comic Sans MS" color="#666666">General 
            Information</font></td>
          </tr>
        </table>
        </td>
        <td width="50%" height="19">&nbsp;</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#F0F0F0" height="62">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber9">
      <tr>
        <td width="50%" valign="top"><b>
        <font size="2" face="Arial" color="#666666">Shipment Type :&nbsp;&nbsp;&nbsp;&nbsp;</font></b>
<select size="1" name="g1">
<option selected>Select here</option>
<option>Document</option>
<option>Parcel</option>
</select><table border="0" cellspacing="1" width="100%" id="AutoNumber11">
          <tr>
            <td width="100%"><b>
        <font size="2" face="Arial" color="#666666">Picked up at :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b><INPUT TYPE="text" name="g5" size="20">
</td>
          </tr>
          <tr>
            <td width="100%">&nbsp;</td>
          </tr>
        </table>
        </td>
        <td width="50%">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber10">
          <tr>
            <td width="100%" align="center"><b>
           <font face="Arial" size="2" color="#666666">Weigth :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </font></b><font face="Arial" color="#666666"><b>
            <INPUT TYPE="text" name="g2" size="20"></b></font></td></td>
          </tr>
          <tr>
            <td width="100%" align="center"><b>
            <font face="Arial" size="2" color="#666666">Rate :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="g3" size="20"></b></font></td>
          </tr>
          <tr>
            <td width="100%" align="center"><b>
            <font face="Arial" size="2" color="#666666">Total Amount :</font></b><font face="Arial" color="#666666"><b>
<INPUT TYPE="text" name="g4" size="20" onfocus=mul(this)></b></font></td>
          </tr>
          <tr>
            <td width="100%" align="center">
            <p align="right"><font face="Arial" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            (above amount including 20% discount)</font></td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    <b><font size="2" color="#666666" face="Arial">&nbsp;&nbsp; </font></b>
    <p align="center">&nbsp;<input TYPE="submit" value="submit"   onClick='validatebill();'>&nbsp; <INPUT TYPE="reset" value="Clear"></td>
  </tr>
</table>

<p>&nbsp;</p>
</form>
</body>

</html>